org.eclipse.vtp.framework.interactions.voice.vxml
Class Option

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.Option
All Implemented Interfaces:
VXMLConstants

public class Option
extends Widget
implements VXMLConstants

The Option class represents the <option> VXML element. Options are used to enumerate valid inputs within field form elements. The DTMF of each option can be provided, or one will be assigned by the field element during processing. A value can be defined that will be assigned to the field element if the option is selected. A TTS output can associated with an option that will be played to the caller. Unlike the Choice element, only TTS is supported.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
Option()
          Creates a new instance of Option with no DTMF grammar, value, or TTS output.
Option(BasicOutput output)
          Creates a new instance of Option with the specified TTS output.
Option(BasicOutput output, java.lang.String dtmf)
          Creates a new instance of Option with the specified TTS output and DTMF grammar.
Option(BasicOutput output, java.lang.String dtmf, java.lang.String value)
          Creates a new instance of Option with the specified TTS output, DTMF grammar, and value.
 
Method Summary
 java.lang.String getDTMF()
          Returns the DTMF grammar that selects this option.
 BasicOutput getOutput()
          Returns the TTS output that is played to the caller when this option is enumerated to the caller.
 java.lang.String getValue()
          Returns the value that will be assigned to the field element if this option is selected.
 void setDTMF(java.lang.String dtmf)
          Sets the DTMF grammar that selects this option.
 void setOutput(BasicOutput output)
          Sets the TTS output that is played to the caller when this option is enumerated to the caller.
 void setValue(java.lang.String value)
          Sets the value that will be assigned to the field element if this option is selected.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this option to the supplied set.
protected  void writeOutput(org.xml.sax.ContentHandler outputHandler)
          Write the output in this option to the specified content handler.
 void writeWidget(org.xml.sax.ContentHandler outputHandler)
          Writes the content of this widget to an XML content handler.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Option

public Option()
Creates a new instance of Option with no DTMF grammar, value, or TTS output.


Option

public Option(BasicOutput output)
Creates a new instance of Option with the specified TTS output. The DTMF grammar and value fields are initialized to null.

Parameters:
output - The TTS output to play to the caller.

Option

public Option(BasicOutput output,
              java.lang.String dtmf)
       throws java.lang.IllegalArgumentException
Creates a new instance of Option with the specified TTS output and DTMF grammar. The value field is initialized to null. Throws an IllegalArgumentException if the dtmf argument is an empty string.

Parameters:
output - The TTS output to play to the caller.
dtmf - The DTMF grammar that selects this option.
Throws:
java.lang.IllegalArgumentException - If the supplied DTMF value is empty.

Option

public Option(BasicOutput output,
              java.lang.String dtmf,
              java.lang.String value)
       throws java.lang.IllegalArgumentException
Creates a new instance of Option with the specified TTS output, DTMF grammar, and value. Throws an IllegalArgumentException if the dtmf or value arguments are empty strings.

Parameters:
output - The TTS output to play to the caller.
dtmf - The DTMF grammar that selects this option.
value - The value to assign to the field element if this option is selected.
Throws:
java.lang.IllegalArgumentException - If the supplied DTMF value is empty.
java.lang.IllegalArgumentException - If the supplied option value is empty.
Method Detail

getOutput

public BasicOutput getOutput()
Returns the TTS output that is played to the caller when this option is enumerated to the caller.

Returns:
the TTS output that is played to the caller when this option is enumerated to the caller.

getDTMF

public java.lang.String getDTMF()
Returns the DTMF grammar that selects this option.

Returns:
the DTMF grammar that selects this option.

getValue

public java.lang.String getValue()
Returns the value that will be assigned to the field element if this option is selected.

Returns:
the value that will be assigned to the field element if this option is selected.

setOutput

public void setOutput(BasicOutput output)
Sets the TTS output that is played to the caller when this option is enumerated to the caller.

Parameters:
output - The TTS output to play to the caller

setDTMF

public void setDTMF(java.lang.String dtmf)
             throws java.lang.IllegalArgumentException
Sets the DTMF grammar that selects this option. Throws an IllegalArgumentException if the DTMF argument is an empty string.

Parameters:
dtmf - The DTMF grammar
Throws:
java.lang.IllegalArgumentException - If the supplied DTMF value is empty.

setValue

public void setValue(java.lang.String value)
Sets the value that will be assigned to the field element if this option is selected. Throws an IllegalArgumentException if the value argument is an empty string.

Parameters:
value - The value to assign to the field
Throws:
java.lang.IllegalArgumentException - If the supplied option value is empty.

writeWidget

public void writeWidget(org.xml.sax.ContentHandler outputHandler)
                 throws java.lang.NullPointerException,
                        org.xml.sax.SAXException
Description copied from class: Widget
Writes the content of this widget to an XML content handler.

Specified by:
writeWidget in class Widget
Parameters:
outputHandler - The handler to write this widget to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of this widget fails.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this option to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.

writeOutput

protected void writeOutput(org.xml.sax.ContentHandler outputHandler)
                    throws java.lang.NullPointerException,
                           org.xml.sax.SAXException
Write the output in this option to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing the output fails.